package p2p.peer.client;

import java.util.HashSet;
import java.util.Set;

public class ClientManager {

	private Set<Client> clients;

	private static ClientManager instance;

	private ClientManager() {

		this.clients = new HashSet<Client>();

	}

	public static ClientManager getInstance() {

		if (instance == null)
			instance = new ClientManager();

		return instance;

	}

	public Set<Client> getClients() {
		return clients;
	}

	public synchronized void addClient(Client c) {

		this.clients.add(c);

	}

	public synchronized void clearClients() {

		this.clients.clear();

	}

}
